/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-11-10 11:01:50
 * @LastEditTime: 2022-11-10 13:43:58
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
 */
let instance = axios.create();
instance.defaults.baseURL = "http://127.0.0.1:8888";
instance.defaults.headers["Content-Type"] = "multipart/form-data";
instance.defaults.transformRequest = (data, headers) => {
  const contentType = headers["Content-Type"];
  if (contentType === "application/x-www-form-urlencoded") return Qs.stringify(data);
  return data;
};
instance.interceptors.response.use((response) => {
  return response.data;
});
